﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArtemisTest
{
    public enum ComponentType
    {
        not_specified,
        bounds,
        position,
        physics,
        set_pos,
        img,
        script,
        sound,
        sound_player,
        dynamic,
        velocity,
        velocity_max,
        input,
        //input_script,
        //controller_script,
        mouse_button_script,
        mouse_move_script,
        keyboard_key_script,
    }


    public abstract class Component
    {
        long _uid;
        ComponentType _componentType = ComponentType.not_specified;
        List<string> _tags = null;

        #region Accessors
        public long UID
        {
            get { return _uid; }
        }

        public ComponentType Type
        {
            get { return _componentType; }
        }

        public List<string> Tags
        {
            get { return _tags; }
        }

        #endregion

        public Component(long UID, ComponentType c)
        {
            _uid = UID;
            _componentType = c;
            _tags = new List<string>();
        }

        public void AddTag(string t)
        {
            if (!HasTag(t))
            {
                _tags.Add(t);
            }
            else
            {
                throw new Exception("Adding duplicate tag");
            }
        }
        public bool HasTag(string t)
        {
            for (int i = 0; i < _tags.Count; i++)
            {
                if (_tags[i] == t) { return true; }
            }
            return false;
        }
    }
}
